Skip to content

Keep scalar arithmetic outside lifted emission work - #668

Open
jogibear9988 wants to merge 1 commit into
dadhi:masterfrom
jogibear9988:fix/scalar-arithmetic-frame-20261114
Open

jogibear9988 wants to merge 1 commit into
dadhi:masterfrom
jogibear9988:fix/scalar-arithmetic-frame-20261114

Conversation

@jogibear9988

Copy link
Copy Markdown
Contributor

Route ordinary primitive arithmetic through a small emitter and retain the existing emitter for nullable operands, complex arguments and spills.

Tests cover scalar/lifted arithmetic and operands observing completed finalizers; the existing arithmetic suites cover operator boundaries.

Validation

Full Release solution build and Standard/LightExpression native runners pass for net8.0, net10.0 and net472. net8.0: 688 TestX and 1744 legacy cases; net10.0: 688 TestX and 1745 legacy cases; net472: 669 TestX and 1610 legacy cases.

Measurements

FEC on master da14580f10fd19ae2361a8e91cfad4b2dfec182a → this change 123b8adb14dedf6cfd11d16f0c55780060a9d021. Windows ARM64; .NET 8.0.28 and 10.0.9; SDK 10.0.301.

Trees, API conversions and invocation adapters are built before measurement. Compilation includes delegate creation; runtime measures the compiled delegate through the same adapter. Both sides are FEC: “System trees” names the expression API, not the System compiler.

Two opposite-load-order process rounds; seven alternating paired samples per round; medians of 14 samples, 100 ms calibration target. Verified task-local runtimes; tiered compilation disabled; each process pinned to one logical CPU. Allocations use GC.GetAllocatedBytesForCurrentThread. Slower observations are retained. Timing variation, including unchanged IL controls, prevents a blanket speedup or no-regression claim.

Runtime / API Workload Compile μs, master → patch Compile B/op Runtime ns, master → patch Runtime B/op
net10.0 / LightExpression arithmetic_after_try 2.884 → 3.356 1472.0 3.556 → 3.661 0.0
net10.0 / LightExpression decimal_add 2.592 → 2.585 1024.0 6.507 → 6.744 0.0
net10.0 / LightExpression ref_compound 2.488 → 2.671 880.0 3.753 → 3.297 0.0
net10.0 / LightExpression scalar_add 2.624 → 2.976 872.0 3.304 → 3.278 0.0
net10.0 / System trees arithmetic_after_try 3.190 → 3.554 1472.0 2.656 → 3.052 0.0
net10.0 / System trees decimal_add 3.237 → 3.112 1024.0 5.580 → 5.964 0.0
net10.0 / System trees ref_compound 3.009 → 4.257 880.0 2.847 → 2.533 0.0
net10.0 / System trees scalar_add 3.963 → 2.851 872.0 3.176 → 3.017 0.0
net8.0 / LightExpression arithmetic_after_try 3.745 → 3.751 1472.0 2.251 → 2.756 0.0
net8.0 / LightExpression decimal_add 4.868 → 4.269 1064.0 6.735 → 6.712 0.0
net8.0 / LightExpression ref_compound 3.942 → 4.454 880.0 2.614 → 2.544 0.0
net8.0 / LightExpression scalar_add 2.881 → 3.334 872.0 2.741 → 2.856 0.0
net8.0 / System trees arithmetic_after_try 6.185 → 5.591 1472.0 3.015 → 3.243 0.0
net8.0 / System trees decimal_add 4.561 → 4.565 1064.0 6.982 → 7.580 0.0
net8.0 / System trees ref_compound 5.564 → 4.903 880.1 3.959 → 4.186 0.0
net8.0 / System trees scalar_add 4.299 → 4.071 872.0 2.760 → 2.591 0.0

Shared-workload emitted IL is unchanged.

Allocation changes: none beyond measurement rounding in these shared workloads.

Route ordinary primitive arithmetic through a small emitter and retain the existing emitter for nullable operands, complex arguments and spills.

Tests cover scalar/lifted arithmetic and operands observing completed finalizers; the existing arithmetic suites cover operator boundaries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant